home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Rexx / Swapconfigs.rexx < prev    next >
OS/2 REXX Batch file  |  2000-05-08  |  1KB  |  37 lines

  1. /* Multiple cron.config file
  2. ** v2.0 by Jim Hines
  3. ** v2.1 Added a delay between the two copies.
  4. ** Modify this script however you like.
  5. ** Use the configfile for the argument. Complete paths MUST be given.
  6. ** There will be a default 12 second delay in the actual coping of config files
  7. ** to deal with file locks from the daemon. This can be changed though by adding
  8. ** a second argument in seconds. ie: rx swapconfig myconfigpath 30
  9. ** would create a 30 second delay instead of the default 12 second delay.
  10. */
  11.     arg file tdelay
  12.     if file = '' then do
  13.         call message('No argument.')
  14.         exit
  15.     end
  16.     if tdelay = '' then tdelay = 12    /* 12 seconds */
  17.     if tdelay ~= '' then do
  18.         tdelay = tdelay * 50    /* Convert seconds to ticks */
  19.     end
  20.     if ~exists('EZCron:prefs/config.prefs') then configfile = 't:cron.config'
  21.     else do
  22.         call open(configprefs, 'EZCron:Prefs/config.prefs', 'R')
  23.         configfile = readln(configprefs)
  24.         call close(configprefs)
  25.     end
  26.     if configfile ~= '' then do
  27.         address command 'copy' file 's:cron.config'
  28.         call delay(tdelay)    /* This 12 second delay is necessary to keep from conflicts with the daemon */
  29.         address command 'copy' file configfile
  30.     end
  31.     address EZCRONPREFS refresh
  32.     exit
  33.  
  34. message: procedure
  35.     call rtezrequest(arg(1),'Okay!','Load EZCron config Error','rt_reqpos = reqpos_centerscr rtez_flags=ezreqf_centertext',)
  36.     exit
  37.